From 381a1cb5c14270d9bdc8cd56f17c75d79df231de Mon Sep 17 00:00:00 2001
From: real-zephex <zephex-1@outlook.com>
Date: Fri, 5 Apr 2024 09:57:47 +0530
Subject: added caching and video player

---
 src/app/kdrama/[id]/page.jsx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'src/app/kdrama/[id]/page.jsx')

diff --git a/src/app/kdrama/[id]/page.jsx b/src/app/kdrama/[id]/page.jsx
index cd3af74..c891a0b 100644
--- a/src/app/kdrama/[id]/page.jsx
+++ b/src/app/kdrama/[id]/page.jsx
@@ -1,9 +1,14 @@
 import styles from "../styles/info.module.css";
 import Image from "next/image";
+import EpisodesButtons from "./buttons";
+import VideoLinkCacher from "../components/cacher";
+
 export default async function DramaInfo({ params }) {
 	const id = decodeURIComponent(params.id);
 	const info = await getDramaInfo(id);
 
+	await VideoLinkCacher(info.episodes, id);
+
 	return (
 		<div className={styles.Main}>
 			{info && (
@@ -19,6 +24,7 @@ export default async function DramaInfo({ params }) {
 						/>
 					</div>
 
+					{/* Drama description */}
 					<div className={styles.DramaDescription}>
 						<h2>Description</h2>
 						<p>{info.description}</p>
@@ -45,6 +51,9 @@ export default async function DramaInfo({ params }) {
 								</span>
 							))}
 					</div>
+
+					{/* Episodes Buttons */}
+					<EpisodesButtons data={info.episodes} id={id} />
 				</div>
 			)}
 		</div>
@@ -53,7 +62,8 @@ export default async function DramaInfo({ params }) {
 
 async function getDramaInfo(id) {
 	const res = await fetch(
-		`https://consumet-api-di2e.onrender.com/movies/dramacool/info?id=${id}`
+		`https://consumet-api-di2e.onrender.com/movies/dramacool/info?id=${id}`,
+		{ next: { revalidate: 86400 } }
 	);
 	const data = await res.json();
 	return data;
-- 
cgit v1.2.3

